#ifndef GAME_H
#define GAME_H

#include <QString>
#include <QList>
class Game
{
  public:
    struct Turn
    {
      Turn(unsigned int p, bool b)
        : points(p), bagWasMade(b) {}
      unsigned int points;
      bool bagWasMade;
    };

    Game();
    Game(const QList<QString>& tokens);
    const QString& player1() const;
    const QString& player2() const;
    const QList<Turn>& turns() const;
    bool isNull() const;
    bool forfeit() const;
    const QString& forfeiter() const;
    const QString& winner() const;
    const QString& loser() const;
    bool addTurn(unsigned int points, bool bagWasMade=false);
    bool editTurn(int turn, unsigned int points, bool bagWasmade=false);
    void setPlayers(const QString& player1, const QString& player2);
    QString toString() const;
    bool isOver() const;

  protected:
    QString mPlayer1, mPlayer2;
    QList<Turn> mTurns;
    bool mIsNull, mForfeit;
    QString mForfeiter, mWinner, mLoser;
};

#endif // GAME_H
